Skip to content

analytics: report sessionDepth as a number in both analytics generations - #385

Merged
etiennelatendresse-optable merged 1 commit into
masterfrom
analytics/session-depth-number
Nov 11, 2026
Merged

etiennelatendresse-optable merged 1 commit into
masterfrom
analytics/session-depth-number

Conversation

@etiennelatendresse-optable

@etiennelatendresse-optable etiennelatendresse-optable commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

sessionDepth reached consumers as a string or a number depending on timing: sessionStorage stringifies on write, so a stored depth read back as "3", while the || 1 fallback supplied the number 1 when the key was missing. The parity harness caught the two types on one field.

What changed

  • optable.prebid.auction payloads report sessionDepth as a number in every case, where a session with a stored depth previously sent a string.
  • auction_processed payloads do the same, reading optableSessionDepthIndex through Number().
  • No case changes value: the writers start at 1, so the "0" the old truthiness check would have passed through never occurs.

How to Test

  • Tested
  • Docs updated — if this adds, changes or removes anything a consumer calls, update the module's .md alongside the code (for example lib/addons/<addon>.md) and the matching README section. New addons ship with a new .md.

Notes

  • Breaking change
  • Requires release

@etiennelatendresse-optable
etiennelatendresse-optable merged commit 30c0651 into master Nov 11, 2026
7 checks passed
@etiennelatendresse-optable
etiennelatendresse-optable deleted the analytics/session-depth-number branch November 11, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants